home *** CD-ROM | disk | FTP | other *** search
/ Merciful 4 / Merciful - Disc 4.iso / rexx / embossanim.pprx < prev    next >
Text File  |  1996-11-01  |  3KB  |  116 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1995-1996 Cloanto Italia srl */
  2.  
  3. /* $VER: EmbossAnim.pprx 1.0 */
  4.  
  5. /** ENG
  6.  This script applies the emboss filter to the current animation. This
  7.  script is mainly intended as a component that can be modified, extended
  8.  or otherwise integrated with other programs.
  9. */
  10.  
  11. /** DEU
  12.  Mit diesem Skript läßt sich der Relieffilter auf die aktuelle
  13.  Animation anwenden. Es läßt sich darüber hinaus auch als Komponente
  14.  für andere Operationen verwenden und entsprechend modifizieren,
  15.  erweitern oder auf anderem Wege mit anderen Programmen nutzen.
  16. */
  17.  
  18. IF ARG(1, EXISTS) THEN
  19.     PARSE ARG PPPORT
  20. ELSE
  21.     PPPORT = 'PPAINT'
  22.  
  23. IF ~SHOW('P', PPPORT) THEN DO
  24.     IF EXISTS('PPaint:PPaint') THEN DO
  25.         ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  26.         DO 30 WHILE ~SHOW('P',PPPORT)
  27.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  28.         END
  29.     END
  30.     ELSE DO
  31.         SAY "Personal Paint could not be loaded."
  32.         EXIT 10
  33.     END
  34. END
  35.  
  36. IF ~SHOW('P', PPPORT) THEN DO
  37.     SAY 'Personal Paint Rexx port could not be opened'
  38.     EXIT 10
  39. END
  40.  
  41. ADDRESS VALUE PPPORT
  42. OPTIONS RESULTS
  43. OPTIONS FAILAT 10000
  44.  
  45. Get 'LANG'
  46. IF RESULT = 1 THEN DO        /* Deutsch */
  47.     txt_req_load      = 'Animation auswählen'
  48.     txt_err_abort     = 'Verarbeitung wurde abgebrochen'
  49.     txt_err_proc      = 'Fehler bei der Verarbeitung: '
  50.     txt_err_oldclient = 'Für dieses Skript_ist eine neuere Version_von Personal Paint erforderlich'
  51. END
  52. ELSE IF RESULT = 2 THEN DO        /* Italiano */
  53.     txt_req_load      = 'Selezionare animazione'
  54.     txt_err_abort     = 'Elaborazione annullata'
  55.     txt_err_proc      = 'Errore nell''elaborazione: '
  56.     txt_err_oldclient = 'Questa procedura richiede_una versione più recente_di Personal Paint'
  57. END
  58. ELSE DO        /* English */
  59.     txt_req_load      = 'Select Animation'
  60.     txt_err_abort     = 'User abort during processing'
  61.     txt_err_proc      = 'Error during processing: '
  62.     txt_err_oldclient = 'This script requires a newer_version of Personal Paint'
  63. END
  64.  
  65. Version 'REXX'
  66. IF RESULT < 7 THEN DO
  67.     RequestNotify 'PROMPT "'txt_err_oldclient'"'
  68.     EXIT 10
  69. END
  70.  
  71. /*
  72.    Change the variable below to use another filter
  73.    and/or edit and use a Set command such as the following one
  74. */
  75.  
  76. filtername = 'Emboss High'
  77.  
  78. /*
  79.    Set '"FILTER = ""Emboss High"", 0, 0,0,0,0,0, 0,0,0,0,0, 0,0,1,1,0, 0,0,1,0,-1,  0,0,0,-1,-1,  1, 204,0,0"'
  80. */
  81.  
  82. LockGUI
  83. GetFrames
  84. frames = RESULT
  85. IF frames = 0 THEN DO
  86.     RequestFile '"'txt_req_load'"'
  87.     IF RC = 0 THEN DO
  88.         LoadAnimation RESULT 'NEW'
  89.         GetFrames
  90.         frames = RESULT
  91.     END
  92. END
  93. IF frames > 0 THEN DO
  94.     GetFramePosition
  95.     savepos = RESULT
  96.     errcode = 0
  97.     SetFramePosition 1
  98.     DO fnum = 1 TO frames
  99.         Process '"'filtername'"'
  100.         IF RC ~= 0 THEN DO
  101.             IF RC = 5 THEN
  102.                 errmess = txt_err_abort
  103.             ELSE
  104.                 errmess = txt_err_proc || RC
  105.             errcode = RC
  106.             LEAVE
  107.         END
  108.         SetFramePosition 'NEXT'
  109.     END
  110.     IF errcode > 0 THEN
  111.         RequestNotify 'PROMPT "'errmess'"'
  112.  
  113.     SetFramePosition savepos
  114. END
  115. UnlockGUI
  116.